#!/bin/bash

# 检查 lspci 是否返回空结果
if [ -z "$(lspci -vvd 10de:)" ]; then
    #echo "没有检测到 NVIDIA GPU，脚本将退出。"
    exit 1
fi

echo "category=gpu;sn=;brand=;core=;physicalid=;slot=;speed=;cache="
exit 0

# gpuCount=$(nvidia-smi --list-gpus | wc -l)

# for ((i=1;i<=gpuCount;i++));do
#     model=$(nvidia-smi -i $((i-1)) --query-gpu=name --format=csv,noheader)
#     cache=$(nvidia-smi -i $((i-1)) --query-gpu=memory.total --format=csv,noheader)
#     slot=$(lspci | grep -i nvidia | awk "NR==$(( (i-1)*2 + 1 )) {print \$1}")
#     echo "category=gpu;model=${model};sn=;brand=;core=;physicalid=${i};slot=${slot};speed=;cache=${cache}"
# done
